<template>
  <div id="goods">
<!--    <span class="demonstration">默认 Hover 指示器触发</span>-->
    <el-carousel height="150px">
      <el-carousel-item v-for="item in pics" :key="item.id">
        <img v-bind:src="item.url">
      </el-carousel-item>
    </el-carousel>
    <el-container>
      <el-container>
        <el-aside width="200px">
          <ul>
            <li v-for="item in goods" v-bind:key="item.id">
              {{item.name}}
            </li>
          </ul>
        </el-aside>
        <el-main>
          <ul v-for="item in goods" v-bind:key="item.id">
            <h1>{{item.name}}</h1>
            <ul>
              <li v-for="food in item.foods" v-bind:key="food.id">
                <img v-bind:src="food.icon">
                {{food.name}}
                <el-divider></el-divider>
              </li>
            </ul>
          </ul>
        </el-main>
      </el-container>
    </el-container>
    <div class="menu-wrapper">
    </div>
    <div class="food-wrapper">
    </div>
  </div>
</template>

<script>
import {mapActions, mapGetters} from 'vuex'
export default {
  name: 'Goods',
  data () {
    return {
      pics: [
        {url: require('../../assets/banner1.png')},
        {url: require('../../assets/banner2.png')},
        {url: require('../../assets/banner3.png')}
      ]
    }
  },
  methods: {
    ...mapActions(['getGoods'])
  },
  computed: {
    ...mapGetters(['goods'])
  },
  created () {
    // eslint-disable-next-line no-unused-vars
    var getGoods = this.getGoods()
  }
}
</script>

<style scoped lang="less">
#goods{
  .el-main{
    margin-left: -100px;
    img{
      width: 47px;
    }
  }
  .el-aside{
    ul{
      background-color: #d3dce6;
      width: 90px;
    }
    li{
      height: 60px;
      line-height: 60px;
    }
    li:hover{
      background-color: #888888;
    }
  }
}
.el-carousel{
  margin-top: 70px;
}
.el-carousel__item img {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}
</style>
